﻿<!DOCTYPE html>
<html>
<!-- Head -->
<head>
	<title>管理登陆</title>
	<meta name="keywords" content="管理登陆"/>
	<meta name="description" content="管理登陆"/>
	<!-- Meta-Tags -->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
	<!-- //Meta-Tags -->

	<link href="/static/css/popuo-box.css"  rel="stylesheet" type="text/css" media="all" />

	<!-- Style --> <link rel="stylesheet" href="/static/css/style.css?v=1"  type="text/css" media="all">


</head>
<!-- //Head -->

<!-- Body -->
<body>

<h1>致胜四方管理登陆</h1>

<div class="w3layoutscontaineragileits">
	<form action="#" method="post">
		<input type="text" value="" Name="Username" placeholder="USERNAME" required>
		<input type="password" value="" Name="Password" placeholder="PASSWORD" required>
		<ul class="agileinfotickwthree">
			<li>
				<input type="checkbox" id="brand1" value="">
				<label for="brand1"><span></span>记住</label>
				<a href="#">忘记密码?请联系管理员</a>
			</li>
		</ul>
		<div class="aitssendbuttonw3ls">
			<input type="submit" value="LOGIN">
		</div>
	</form>
</div>




<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js" ></script>

<!-- pop-up-box-js-file -->
<script src="/static/js/jquery.magnific-popup.js"  type="text/javascript"></script>
<!--//pop-up-box-js-file -->
<script src="https://g.alicdn.com/dingding/dingtalk-jsapi/3.0.12/dingtalk.open.js"></script>
<script>
	$(document).ready(function() {
		$('.w3_play_icon,.w3_play_icon1,.w3_play_icon2').magnificPopup({
			type: 'inline',
			fixedContentPos: false,
			fixedBgPos: true,
			overflowY: 'auto',
			closeBtnInside: true,
			preloader: false,
			midClick: true,
			removalDelay: 300,
			mainClass: 'my-mfp-zoom-in'
		});

	});



</script>
<script src="/layuiadmin/layui/layui.js"></script>
<script>
	layui.config({
		base: '/layuiadmin/' //静态资源所在路径
	}).extend({
		index: 'lib/index' //主入口模块
	}).use(['index'],function () {
		var $=layui.$;
		$(function () {
			var localTest = layui.data('account');
			// console.log(localTest)
			if(localTest){
				$("#brand1").attr("checked",true);
				$("input[name='Username']").val(localTest.Username)
				$("input[name='Password']").val(localTest.Password)
			}
		})
		$("form").submit(function () {
			var Username=$("input[name='Username']").val();
			var Password=$("input[name='Password']").val();
			var jizhu=$("#brand1").is(":checked");
			if(jizhu){
				layui.data("account",{key:'Password',value:Password});
				layui.data("account",{key:'Username',value:Username});
			}else{
				layui.data('account', null);
			}
			$.post("loginpost",{Username:Username,Password:Password},function (re) {
				if(re.code==0){
					layer.msg("登陆成功",function () {
						if(re.msg!='' && 1==2){
							window.open("/"+re.msg,"_self");
						}else{
							window.open("/admin/index","_self");
						}
					})
                    layui.data("account",{key:'token',value:re.data.token});
				}else{
					layer.msg(re.msg);
				}
			},"json")
			return false;
		})

        if (dd.env.platform!=="notInDingTalk") {
            //进行钉钉登录操作
            dd.runtime.permission.requestAuthCode({
                corpId: "dingb078ad81cf127529ffe93478753d9884",
                onSuccess: function(result) {
                    var code = result.code
                    $.post("/mlogin/dingLogin",{code:code},function (res){
                        if(res.code == 0){
                            layui.data("account",{key:'token',value:res.data.token});
                            window.open("https://shuiwang.cdyuejia.com/admin/index","_self");
                        }else{
                            layer.msg(res.msg)
                        }
                    },"json")
                },
                onFail : function(err) {
                    alert(JSON.stringify(err))
                }

            })
        }


	});
</script>
</body>
<!-- //Body -->

</html>
